<template>
	<RenderList :parentId="parentId" v-if="isPreview()" />
	<template v-else>
		<div
			class="dropDom"
			@drop="(e) => dragHandle(e, parentId)"
			@dragover="dragoverHandle"
			@dragenter="dragoverHandle"
			@mousedown="mousedownHandleUnStop"
		>
			<EditComponentList :parentId="parentId" />
		</div>
	</template>
</template>

<script setup>
import EditComponentList from '@/views/chart/ContentEdit/EditComponentList.vue';
import RenderList from '@/views/preview/RenderList.vue';
import { dragHandle, dragoverHandle, mousedownHandleUnStop } from '@/views/chart/ContentEdit/hooks/useDrag.hook';
import { isPreview } from '@u';

defineProps({
	parentId: {
		type: String,
		required: true
	}
});
</script>

<style lang="scss" scoped>
.dropDom {
	overflow: auto;
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}
</style>
